import BaseSprite from "../../Base/BaseSprite";
import { EBundleType, EResType } from "../../Common/Enum";
import GameUtil from "../../Util/GameUtil";
import { LoadUtil } from "../../Util/LoadUtil";

const { ccclass, property } = cc._decorator;

@ccclass
export class ItemResIcon extends BaseSprite {

    @property({ type: cc.Sprite, tooltip: "icon" })
    private resIcon: cc.Sprite = null;

    protected onLoad() { }
    protected start() { }

    public refreshIcon(type: EResType, maxWidth: number = 80, maxHeight: number = 80) {
        LoadUtil.instance.setSpriteFrame(this.resIcon, type, null, maxWidth, maxHeight);
    }
}